﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="prosoryadd.aspx.cs" Inherits="WebSite.admin.product.prosoryadd" %>


<%@ Register Src="../languages.ascx" TagName="head" TagPrefix="uc1" %>
<%@ Register assembly="CuteEditor" namespace="CuteEditor" tagprefix="CE" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>良臣直销网 </title>
    <link href="../main.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
        parent.maintitle.innerHTML = "商品管理";
        parent.contentmain.innerHTML = "<span class='title01'>所在位置：</span>添加新配件。&nbsp;&nbsp;<img src='images/sort_desc.gif' /> <a href='product/prosory.aspx' target='content'><font color=#ff0000>配件列表</font></a>"
    </script>
    <script language='javascript'>
	var path=(window.top.location).toString();
	if(path.indexOf('login.aspx')==-1){
	if (path.indexOf('index.aspx')==-1){
	 window.top.location='index.aspx';
	}
	}
	function handlePromote(str)
	{
	var proprice4=document.getElementById('proprice4');
	var prodate1=document.getElementById('prodate1');
	var prodate2=document.getElementById('prodate2');
	if(str.checked)
	{
	 proprice4.disabled=false;
	 prodate1.disabled=false;
	 prodate2.disabled=false;
	}else{
	proprice4.disabled=true;
	 prodate1.disabled=true;
	 prodate2.disabled=true;
	}
	}
	function handleAutoThumb(str)
	{
	var smallpic=document.getElementById('smallpic');
	var file2=document.getElementById('file2');
	var Button2=document.getElementById('Button2');
	
	if(str.checked)
	{
	 smallpic.disabled=true;
	 file2.disabled=true;
	 Button2.disabled=true;
	}else{
	 smallpic.disabled=false;
	 file2.disabled=false;
	 Button2.disabled=false;
	}
	}
	function marprice()
	{
	 var proprice1=document.getElementById('proprice1');
	 var prices=<%=Convert.ToSingle(info.info1("","shoppricebi")) %>;
	 //alert(prices);
	 var proprice3=document.getElementById('proprice3');
	  proprice3.value=((proprice1.value)*prices);
	}
	function markeprice()
	{
	var proprice3=document.getElementById('proprice3');
	proprice3.value=Math.round(proprice3.value);
	}
	</script>
	<script language="javascript" src="../../js/function.js"></script>
    <script language="javascript">
        function CheckFrm() {
            var obj = 'proname,typeid,proprice1';
            var objt = '1,1,8';
            var msg = '配件名称,分类,本店售价';
            var chks = chk(form1, obj, objt, msg)
            if (chks) {
                if (form1.typeid.value == "0") {
                    alert("请选择分类");
                    return false;
                }
            }
            if (!chks) {
                return false;
            }
        }
    </script>
    <script type="text/javascript" language="javascript">
        var i = 1
        function addFile() {
            if (i < 8) {
                var str = '<BR>&nbsp;&nbsp;&nbsp; 规格名：<input name="text" type="text" maxlength="20" style=width:50px />价格：<input name="textprice" type="text" maxlength="20" value="0" style=width:50px />'
                document.getElementById('MyFile').insertAdjacentHTML("beforeEnd", str)

            }
            else {
                alert("您一次最多只能上传8条！")
            }
            i++
        }
        function addsz() {
            if (document.getElementById('s1').style.display == '') {
                document.getElementById('s1').style.display = 'none';
                document.getElementById('MyFile').style.display = '';
                document.form1.Spe.value = "1";
            } else {
                document.getElementById('s1').style.display = '';
                document.getElementById('MyFile').style.display = 'none';
                document.form1.Spe.value = "0";
            }
        }
   </script> 
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <center>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#F1F4F7">
<tr>
<td height="382" align="center" valign="top">
  <br />
  <table Width="98%" border="0" cellpadding="5" cellspacing="0">
    <tr id="cn" style="display:;" runat="server">
      <td width="23%" align="right" class="title01">
          配件名称：</td>
      <td align="left"><input size="30" name="proname" id="proname" runat="server" />*</td>
    </tr>
    <tr>
      <td align="right" class="title01"><a title="点击此处查看提示信息" href="javascript:clicksa(p1);"><img height="16" alt="点击此处查看提示信息" src="../images/notice.gif" width="16" border="0" /></a>
          货号：
      </td>
      <td align="left"><input name="procode" id="procode" runat="server" /><span id="p1" style="display:none"><br />
          如果您不输入货号，系统将自动生成一个唯一的货号。</span></td>
    </tr>
    <tr id="typecn"  style="display:;" runat="server">
      <td align="right" class="title01">
          分类：</td>
      <td align="left"><asp:DropDownList ID="typeid" runat="server">
                    <asp:ListItem Text="配件" Value="268"></asp:ListItem>
                    </asp:DropDownList>
        *</td>
    </tr>
    <tr style="display:none;">
      <td align="right" class="title01">品牌：</td>
      <td align="left">
      <asp:DropDownList ID="propinpai" runat="server">
      <asp:ListItem Value="0">请选择</asp:ListItem>
      </asp:DropDownList>
      
      </td>
    </tr>
      <tr>
          <td align="right" class="title01">
              进货价：</td>
          <td align="left"><input value="0" name="proprice5" id="proprice5" runat="server" />
          </td>
      </tr>
    <tr>
      <td align="right" class="title01">本店售价：</td>
      <td align="left"><input value="0" name="proprice1" id="proprice1" runat="server" />&nbsp;<input name="button" type="button" onClick="marprice();" value="按市场价计算" />*</td>
    </tr>
    <tr>
      <td align="right" class="title01">市场售价：</td>
      <td align="left"><input value="0" name="proprice3" id="proprice3" runat="server" />
          <input name="button" type="button" onClick="markeprice();" value="取整数" />      </td>
    </tr>
    <tr>
      <td align="right" class="title01"><a title="点击此处查看提示信息" href="javascript:clicksa(p2);"><img height="16" alt="点击此处查看提示信息" src="../images/notice.gif" width="16" border="0" /></a>会员价格：</td>
      <td align="left">
          <asp:DataList ID="DataList1" runat="server" RepeatColumns="4" CellPadding="1" ForeColor="#333333" Height="100%" Width="98%">
          <ItemTemplate>
          <%# DataBinder.Eval(Container.DataItem, "rank") %><input id="proprice2_<%# DataBinder.Eval(Container.DataItem, "rankid") %>" name="proprice2_<%# DataBinder.Eval(Container.DataItem, "rankid") %>" value="<%# DataBinder.Eval(Container.DataItem, "price") %>" size=4 />
          </ItemTemplate></asp:DataList>
          <span id="p2" style="display:none">会员价格为-1时表示会员价格按会员等级折扣率计算。你也可以为每个等级指定一个固定价格</span></td>
    </tr>
    
    <tr>
      <td align="right" class="title01">
          购买赠积分数：</td>
      <td align="left"><input value="0" name="proscore1" id="proscore1" runat="server" /></td>
    </tr>
    <tr style="display:none;">
      <td align="right" class="title01"><a title="点击此处查看提示信息" href="javascript:clicksa(p3);"><img height="16" alt="点击此处查看提示信息" src="../images/notice.gif" width="16" border="0" /></a> 积分购买额度：</td>
      <td align="left"><input value="0" name="proscore2" id="proscore2" runat="server" /><span id="p3" style="display:none"><br />购买该配件时最多可以使用多少钱的积分</span></td>
    </tr>
    <tr style="display:none;">
      <td align="right" class="title01">
          <asp:CheckBox ID="iscuxao" runat="server" />
        促销价：</td>
      <td align="left"><asp:TextBox ID="proprice4" runat="server" Enabled="False">0</asp:TextBox>
     </td>
    </tr>
    <tr style="display:none;">
      <td align="right" class="title01" id="promote_5">促销日期：</td>
      <td align="left">
      <asp:TextBox ID="prodate1" runat="server" Enabled="False" style="behavior:url('../../LWDP.HTC');">2007-11-30</asp:TextBox>
        -
        <asp:TextBox ID="prodate2" runat="server" Enabled="False" style="behavior:url('../../LWDP.HTC');">2007-11-30</asp:TextBox>&nbsp;
      </td>
    </tr>
      <tr>
          <td align="right" class="title01">
              规格：</td>
          <td align="left">
              <%=spestr%>
              <div id="s1" style="display:">
              <%if (spe == "0")
                { %>
              如果此配件有多种规格，可点此<a href=javascript:addsz();><font color=blue>添加规格</font></a>
              <%}
                else{ %>
                如果此配件有更多规格，可点此<a href=javascript:addsz();><font color=blue>添加规格</font></a>
                <%} %>
              </div>
              <input type="hidden" name="Spe" value="<%=spe %>" />
              <div id="MyFile" style="display:none">
              <a href="javascript:addFile();">[+]</a> 规格名：<input name="text" type="text"  maxlength="20" style="width: 50px" />价格：<input name="textprice" type="text" value="0" maxlength="20" style="width: 50px" /> <a href=javascript:addsz();><font color=blue>关闭规格</font></a>
              </div></td>
      </tr>
      <tr>
      <td align="right" class="title01">
          简单描述：</td>
      <td align="left"><asp:TextBox ID="promsg" runat="server" Height="58px" TextMode="MultiLine" Width="340px"></asp:TextBox></td>
    </tr>
      <tr>
          <td align="right" class="title01">详细说明
          </td>
          <td align="left">
            <CE:Editor id="WE_NewsContent" runat="server" AutoConfigure="Simple" 
                    BreakElement="Br" Width="100%"  Height="350px" ></CE:Editor>
          </td>
      </tr>
    <tr>
      <td align="right" class="title01">上传商品图片：</td>
      <td align="left"><asp:TextBox ID="bigpic" runat="server"></asp:TextBox><input id="file1" type="file" runat="server" /><asp:Button ID="Button1" runat="server" Text="上传" OnClick="Button1_Click" />&nbsp;
      </td>
    </tr>
    <tr>
      <td align="right" class="title01">上传商品缩略图：</td>
      <td align="left"><asp:TextBox ID="smallpic" runat="server"></asp:TextBox><input disabled="disabled" type="file" name="file2" id="file2" runat="server"/><asp:Button ID="Button2" runat="server" Text="上传" Enabled="false" OnClick="Button2_Click" />
          <br />
          <asp:CheckBox ID="CheckBox1" runat="server" Checked="true" />
        自动生成商品缩略图 </td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td height="50" align="left">
          <asp:ImageButton ID="ImageButton1" ImageUrl="../images/buttom-02.gif" runat="server" OnClick="ImageButton1_Click" />
       <a href="javascript:form1.reset();"><img src="../images/button03.gif" border="0" /></a></td>
      </tr>
  </table></td>
</tr>
</table>
</center>
    </div>
    </form>
</body>
</html>
